package com.dolphin.common.expr.emus;

import lombok.Getter;

/**
 * @author shida
 */

@Getter
public enum StatTypeEnum {
    COUNT("count", "计数", true),
    SUM("sum", "求和", true)
    ;

    private String code;
    private String desc;
    private Boolean targetField;

    StatTypeEnum(String code, String desc, Boolean targetField) {
        this.code = code;
        this.desc = desc;
        this.targetField = targetField;
    }

    public static StatTypeEnum getByCode(String code) {
        for (StatTypeEnum statTypeEnum : StatTypeEnum.values()) {
            if (statTypeEnum.getCode().equals(code)) {
                return statTypeEnum;
            }
        }
        return null;
    }
}
